import {
    NavigatorIOS
} from "react-native";
export default class RouteInterceptor{
    constructor(interceptor,result){
        this.interceptor = interceptor;
        this.result = result;
    }
    push(data){
        this.interceptor(
            new Promise((resolve, reject) => {
                resolve(data);
            })
        )
            .then((data)=>{
                return NavigatorIOS.push(data);
            }).then((result)=>{
                this.result(result);
            })
    }
}